package com.heima.wemedia.thread;

import com.heima.model.wemedia.pojos.WmMaterial;
import com.heima.model.wemedia.pojos.WmUser;

/**
 * @author zzy
 * @date 2022/7/15 14:45
 */

public class UserThreadLocal {
    //声明一个ThreadLocal类型的变量
    private static ThreadLocal<WmUser> threadLocal=new ThreadLocal<>();
    //为这个变量配置一个get set方法
    public static WmUser get(){
        return threadLocal.get();
    }
    public static void set(WmUser wmUser){
        threadLocal.set(wmUser);
    }
    //为这个变量配置一个remove方法
    public void remove(){
        threadLocal.remove();
    }
    //
}
